package cn.edu.sgu.www.mhxysy.enums;

/**
 * 装备类型枚举
 * @author 沐雨橙风ιε
 * @version 1.0
 */
public enum EquipmentTypes {

    /**
     * 武器
     */
    WUQI(1, "武器"),
    /**
     * 衣甲
     */
    YIJIA(2, "衣甲"),
    /**
     * 头
     */
    TOU(3, "头"),
    /**
     * 项链
     */
    XIANGLIAN(4, "项链"),
    /**
     * 腰带
     */
    YAODAI(5, "腰带"),
    /**
     * 鞋子
     */
    XIEZI(6, "鞋子");

    private final Integer value;
    private final String name;

    public Integer getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    EquipmentTypes(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    /**
     * 查询装备类型名称
     * @param type 装备类型的value
     * @return String 装备类型的name
     */
    @Deprecated
    public static String get(Integer type) {
        EquipmentTypes[] values = EquipmentTypes.values();

        for(EquipmentTypes equipmentType : values) {
            if (equipmentType.value.equals(type)) {
                return equipmentType.name;
            }
        }

        return null;
    }

}